﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Microsoft.ISVApps.Common.Utils
{
    public delegate T ResourceAdapter<T>(string key);

    public static class Extensions
    {
        
        public static T Val<T>(this ResourceDictionary self, object key)
        {
            return (T)self[key];

        }

        public static ResourceAdapter<T> GetDefaultResourceAdapter<T>()
        {
            return new ResourceAdapter<T>(Application.Current.Resources.Val<T>);
        }
    }
}
